package com.lcj.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MyController {

    @RequestMapping("/hello")
    public ModelAndView sayHello(String name,int age){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("msg","姓名："+name+",年龄："+age);
        modelAndView.setViewName("hello");
        return modelAndView;
    }
}
